/*
 *-----------------------------------------------------------------------------
 *
 * TEditorRpcCaller.java
 *
 * This file was created from IEditorRpc.idl
 * by the Simple JavRMI backend.
 *
 * Copyright 2008-2010, Evgeny Alexeyev
 * Licensed under the EPL - v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 *
 *-----------------------------------------------------------------------------
 */

package com.googlecode.umlsynch.rpc;

import java.io.*;

import com.googlecode.umlsynch.rpc.base.TIOHandler;

import com.googlecode.umlsynch.rpc.base.IDebug;

import com.googlecode.umlsynch.rpc.base.TDebug;

import com.googlecode.umlsynch.rpc.TFileDescriptor;

import com.googlecode.umlsynch.rpc.TClassDescriptor;

import com.googlecode.umlsynch.rpc.IEditorRpc;


public class TEditorRpcCaller implements IEditorRpc
{
  TIOHandler handler;
  TDebug debug;
  
  public TEditorRpcCaller(TIOHandler hdl, IDebug dbg) {
    handler = hdl;
    debug = new TDebug(dbg);
  }
  
  public void OpenMethodImplementation(TClassOperation desc) {
    if (!handler.connect())
      return;
    
    String data;
    try {
    
      handler.getObjectOutputStream().writeObject(new String("IEditorRpc"));
      handler.getObjectOutputStream().writeObject(new String("OpenMethodImplementation"));
      
      handler.getObjectOutputStream().writeObject(new String("TClassOperation"));
      handler.getObjectOutputStream().writeObject(desc);
      
    }
    catch (IOException e) {
    }
    
    handler.close();
  }; // OpenMethodImplementation
  
  public void OpenMethodDeclaration(TClassOperation desc) {
    if (!handler.connect())
      return;
    
    String data;
    try {
    
      handler.getObjectOutputStream().writeObject(new String("IEditorRpc"));
      handler.getObjectOutputStream().writeObject(new String("OpenMethodDeclaration"));
      
      handler.getObjectOutputStream().writeObject(new String("TClassOperation"));
      handler.getObjectOutputStream().writeObject(desc);
      
    }
    catch (IOException e) {
    }
    
    handler.close();
  }; // OpenMethodDeclaration
  
  public void OpenClass(TClassDescriptor desc) {
    if (!handler.connect())
      return;
    
    String data;
    try {
    
      handler.getObjectOutputStream().writeObject(new String("IEditorRpc"));
      handler.getObjectOutputStream().writeObject(new String("OpenClass"));
      
      handler.getObjectOutputStream().writeObject(new String("TClassDescriptor"));
      handler.getObjectOutputStream().writeObject(desc);
      
    }
    catch (IOException e) {
    }
    
    handler.close();
  }; // OpenClass
  
  public void OpenFile(TFileDescriptor desc, Integer line) {
    if (!handler.connect())
      return;
    
    String data;
    try {
    
      handler.getObjectOutputStream().writeObject(new String("IEditorRpc"));
      handler.getObjectOutputStream().writeObject(new String("OpenFile"));
      
      handler.getObjectOutputStream().writeObject(new String("TFileDescriptor"));
      handler.getObjectOutputStream().writeObject(desc);
      
      handler.getObjectOutputStream().writeObject(new String("Integer"));
      handler.getObjectOutputStream().writeObject(line);
      
    }
    catch (IOException e) {
    }
    
    handler.close();
  }; // OpenFile
  
}; // IEditorRpc

